package com.willy.ratingbar;

import ohos.utils.Parcel;
import ohos.utils.Sequenceable;

/**
 * Created by willy on 2017/11/16.
 */

class SavedState implements Sequenceable {

    private float rating;

    SavedState() {
    }

    private SavedState(Parcel in) {
        rating = in.readFloat();
    }

    public float getRating() {
        return rating;
    }

    public void setRating(float rating) {
        this.rating = rating;
    }

    public static final Producer<SavedState> PRODUCER = new Producer<SavedState>() {

        public SavedState createFromParcel(Parcel in) {
            SavedState adrecordstore = new SavedState(in);
            adrecordstore.unmarshalling(in);
            return adrecordstore;
        }
    };

    @Override
    public boolean marshalling(Parcel parcel) {
        parcel.writeFloat(rating);
        return false;
    }

    @Override
    public boolean unmarshalling(Parcel parcel) {
        rating = parcel.readFloat();
        return false;
    }
}
